home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gtk+.idb / usr / freeware / info / gdk.info.z / gdk.info
Encoding:
GNU Info File  |  1999-07-16  |  10.7 KB  |  330 lines

  1. This is Info file gdk.info, produced by Makeinfo version 1.68 from the
  2. input file gdk.texi.
  3.  
  4.    This file documents GDK, the General Drawing Kit
  5.  
  6.    Copyright (C) 1996 Peter Mattis
  7.  
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that the
  14. entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.  
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that this permission notice may be stated in a
  20. translation approved by Peter Mattis.
  21.  
  22. INFO-DIR-SECTION User Interface Toolkit
  23. START-INFO-DIR-ENTRY
  24. * GDK: (gdk).        The General Drawing Kit
  25. END-INFO-DIR-ENTRY
  26.  
  27. 
  28. File: gdk.info,  Node: Top,  Next: Copying,  Prev: (dir),  Up: (dir)
  29.  
  30. The General Drawing Kit
  31. ***********************
  32.  
  33.    This is edition 1.0 of the GDK documentation, 16 May 1996.
  34.  
  35. * Menu:
  36.  
  37. * Copying::                     Your rights.
  38. * Overview::                    What is GDK?
  39. * Initialization::              Initialization and exit.
  40. * Events::                      Event handling.
  41. * Visuals::                     Understanding and using visuals.
  42. * Windows::                     Creating and using windows.
  43. * Graphics Contexts::           Creating and modifying GCs.
  44. * Pixmaps::                     Creating pixmaps.
  45. * Images::                      Creating images.
  46. * Color::                       Specifying color.
  47. * Fonts::                       Creating fonts.
  48. * Drawing::                     Drawing commands.
  49. * XInput Support::              Using extended devices.
  50. * Miscellany::                  Other stuff.
  51. * Examples::                    Using GDK.
  52. * Function Index::              Index of functions
  53. * Concept Index::               Index of concepts
  54.  
  55. 
  56. File: gdk.info,  Node: Copying,  Next: Overview,  Prev: Top,  Up: Top
  57.  
  58. Copying
  59. *******
  60.  
  61.    GDK is "free"; this means that everyone is free to use it and free
  62. to redestribute it on a free basis. GDK is not in the public domain; it
  63. is copyrighted and there are restrictions on its distribution, but these
  64. restrictions are designed to permit everything that a good cooperating
  65. citizen would want to do. What is not allowed is to try to prevent
  66. others from further sharing any version of GDK that they might get from
  67. you.
  68.  
  69.    Specifically, we want to make sure that you have the right to give
  70. away copies of GDK, that you receive source code or else can get it if
  71. you want it, that you can change GDK or use pieces of it in new free
  72. programs, and that you know you can do these things.
  73.  
  74.    To make sure that everyone has such rights, we have to forbid you to
  75. deprive anyone else of these rights. For example, if you distribute
  76. copies of GDK, you must give the recipients all the rights that you
  77. have. You must make sure that they, too, receive or can get the source
  78. code. And you must tell them their rights.
  79.  
  80.    Also, for my own protection, we must make certain that everyone finds
  81. out that there is no warranty for GDK. If GDK is modified by someone
  82. else and passed on, we want their recipients to know that what they have
  83. is not what we distributed, so that any problems introduced by others
  84. will no reflect on our reputation.
  85.  
  86.    The precise conditions of the licenses for GDK are found in the
  87. General Public Licenses that accompanies it.
  88.  
  89. 
  90. File: gdk.info,  Node: Overview,  Next: Initialization,  Prev: Copying,  Up: Top
  91.  
  92. What is GDK?
  93. ************
  94.  
  95.    GDK is designed as a wrapper library that lies on top of Xlib. It
  96. performs many common and desired operations for a programmer instead of
  97. the programmer having to explicitly ask for such functionality from
  98. Xlib directly. For example, GDK provides a common interface to both
  99. regular and shared memory XImage types. By doing so, an application can
  100. nearly transparently use the fastest image type available. GDK also
  101. provides routines for determining the best available color depth and
  102. the best available visual which is not always the default visual for a
  103. screen.
  104.  
  105. 
  106. File: gdk.info,  Node: Initialization,  Next: Events,  Prev: Overview,  Up: Top
  107.  
  108. Initialization and exit
  109. ***********************
  110.  
  111.    Initializing GDK is easy. Simply call `gdk_init' passing in the ARGC
  112. and ARGV parameters. Exit is similarly easy. Just call `gdk_exit'.
  113.  
  114.  - Function: void gdk_init (int *ARGC, char ***ARGV)
  115.      Initializes the GDK library. The arguments ARGC and ARGV are
  116.      scanned and any arguments that GDK recognizes are handled and
  117.      removed. The ARGC and ARGV parameters are the values passed to
  118.      `main' upon program invocation.
  119.  
  120.  - Function: void gdk_exit (int ERRORCODE)
  121.      Exit GDK and perform any necessary cleanup. `gdk_exit' will call
  122.      the systems `exit' function passing ERRORCODE as the parameter.
  123.  
  124.      int
  125.      main (int argc, char *argv[])
  126.      {
  127.        /* Initialize GDK. */
  128.        gdk_init (&argc, &argv);
  129.      
  130.        /* Exit from GDK...this call will never return. */
  131.        gdk_exit (0);
  132.      
  133.        /* Keep compiler from issuing a warning */
  134.        return 0;
  135.      }
  136.  
  137. 
  138. File: gdk.info,  Node: Events,  Next: Visuals,  Prev: Initialization,  Up: Top
  139.  
  140. Event handling
  141. **************
  142.  
  143.    Events are the means by which GDK lets the programmer know of user
  144. interaction. An event is normally a button or key press or some other
  145. indirect user action, such as a the mouse cursor entering or leaving a
  146. window.
  147.  
  148.    There exist only a few functions for getting events and event
  149. information. These are `gdk_events_pending', `gdk_event_get',
  150. `gdk_events_record' and `gdk_events_playback'. The latter two functions
  151. are useful for automatic testing of a software package and should
  152. normally not be needed in a program.
  153.  
  154.  - Function: gint gdk_events_pending (void)
  155.      Returns the number of events pending on the event queue.
  156.  
  157.  - Function: gint gdk_event_get (GdkEvent *EVENT)
  158.      Return the next available event in the EVENT structure.
  159.      `gdk_event_get' will return `TRUE' on success and `FALSE' on
  160.      failure. Success and failure is determined by whether an event
  161.      arrived before the timeout period expired.
  162.  
  163.  - Function: void gdk_events_record (char *FILENAME)
  164.      Turn on recording of events. User events and certain system events
  165.      will be saved in the file named by the variable FILENAME. This
  166.      stream of events can later be played back and "should" produce the
  167.      same results as when the original events were handled. However, the
  168.      programmer does need to be careful in that the state of the
  169.      program must be the same when `gdk_events_record' is called and
  170.      when `gdk_events_playback' is called. For this reason,
  171.      `gdk_events_record' is normally not called directly, but is instead
  172.      invoked indirectly by specifying the "-record" command line option.
  173.  
  174.  - Function: void gdk_events_playback (char *FILENAME)
  175.      Start playback of events from a file. (See the above description of
  176.      `gdk_events_record'). Normally this function is not called directly
  177.      but is invoked by the "-playback" command line option.
  178.  
  179.  - Function: void gdk_events_stop (void)
  180.      Stop recording and playback of events.
  181.  
  182.      void
  183.      handle_event ()
  184.      {
  185.        GdkEvent event;
  186.      
  187.        if (gdk_event_get (&event))
  188.          {
  189.            switch (event.type)
  190.             {
  191.               ...
  192.             }
  193.          }
  194.      }
  195.  
  196. 
  197. File: gdk.info,  Node: Visuals,  Next: Windows,  Prev: Events,  Up: Top
  198.  
  199. Understanding and using visuals
  200. *******************************
  201.  
  202. 
  203. File: gdk.info,  Node: Windows,  Next: Graphics Contexts,  Prev: Visuals,  Up: Top
  204.  
  205. Creating and using windows
  206. **************************
  207.  
  208. 
  209. File: gdk.info,  Node: Graphics Contexts,  Next: Pixmaps,  Prev: Windows,  Up: Top
  210.  
  211. Creating and modifying GCs
  212. **************************
  213.  
  214. 
  215. File: gdk.info,  Node: Pixmaps,  Next: Images,  Prev: Graphics Contexts,  Up: Top
  216.  
  217. Creating pixmaps
  218. ****************
  219.  
  220. 
  221. File: gdk.info,  Node: Images,  Next: Color,  Prev: Pixmaps,  Up: Top
  222.  
  223. Creating images
  224. ***************
  225.  
  226. 
  227. File: gdk.info,  Node: Color,  Next: Fonts,  Prev: Images,  Up: Top
  228.  
  229. Specifying color
  230. ****************
  231.  
  232. 
  233. File: gdk.info,  Node: Fonts,  Next: Drawing,  Prev: Color,  Up: Top
  234.  
  235. Creating Fonts
  236. **************
  237.  
  238. 
  239. File: gdk.info,  Node: Drawing,  Next: XInput Support,  Prev: Fonts,  Up: Top
  240.  
  241. Drawing Commands
  242. ****************
  243.  
  244. 
  245. File: gdk.info,  Node: XInput Support,  Next: Miscellany,  Prev: Drawing,  Up: Top
  246.  
  247. Using extended devices
  248. **********************
  249.  
  250. 
  251. File: gdk.info,  Node: Miscellany,  Next: Examples,  Prev: XInput Support,  Up: Top
  252.  
  253. Other stuff
  254. ***********
  255.  
  256. 
  257. File: gdk.info,  Node: Examples,  Next: Function Index,  Prev: Miscellany,  Up: Top
  258.  
  259. Using GDK
  260. *********
  261.  
  262. 
  263. File: gdk.info,  Node: Function Index,  Next: Concept Index,  Prev: Examples,  Up: Top
  264.  
  265. Variable Index
  266. **************
  267.  
  268. * Menu:
  269.  
  270. * gdk_event_get:                         Events.
  271. * gdk_events_pending:                    Events.
  272. * gdk_events_playback:                   Events.
  273. * gdk_events_record:                     Events.
  274. * gdk_events_stop:                       Events.
  275. * gdk_exit:                              Initialization.
  276. * gdk_init:                              Initialization.
  277.  
  278. 
  279. File: gdk.info,  Node: Concept Index,  Prev: Function Index,  Up: Top
  280.  
  281. Concept Index
  282. *************
  283.  
  284. * Menu:
  285.  
  286. * Color:                                 Color.
  287. * Controlling extended devices:          XInput Support.
  288. * Debugging:                             Miscellany.
  289. * Drawing:                               Drawing.
  290. * Events:                                Events.
  291. * Examples:                              Examples.
  292. * Exit:                                  Initialization.
  293. * Fonts:                                 Fonts.
  294. * GC:                                    Graphics Contexts.
  295. * Graphics Contexts:                     Graphics Contexts.
  296. * Images:                                Images.
  297. * Initialization:                        Initialization.
  298. * Miscellaneous:                         Miscellany.
  299. * Overview <1>:                          XInput Support.
  300. * Overview:                              Overview.
  301. * Pixmaps:                               Pixmaps.
  302. * Timers:                                Miscellany.
  303. * Using extended device capabilities:    XInput Support.
  304. * Visuals:                               Visuals.
  305. * Windows:                               Windows.
  306.  
  307.  
  308. 
  309. Tag Table:
  310. Node: Top959
  311. Node: Copying2025
  312. Node: Overview3567
  313. Node: Initialization4244
  314. Node: Events5269
  315. Node: Visuals7542
  316. Node: Windows7682
  317. Node: Graphics Contexts7823
  318. Node: Pixmaps7964
  319. Node: Images8084
  320. Node: Color8190
  321. Node: Fonts8296
  322. Node: Drawing8399
  323. Node: XInput Support8515
  324. Node: Miscellany8648
  325. Node: Examples8760
  326. Node: Function Index8868
  327. Node: Concept Index9358
  328. 
  329. End Tag Table
  330.